/*
 * Copyright 2017 Baiyyy
 * @(#)WorkingState.java
 */

package com.byyy.ccts.modules.ysjl.enums;

/**
 * 工作状态枚举
 */
public enum UserVipStyleEnum implements EnumInterface  {

    STYLEONE(1, "阴暗腹黑系"),
    STYLETWO(2, "护眼蓝绿系"),
    STYLETHREE(3, "公主粉色系"),
    STYLEFOUR(4, "LSP色系"),
    STYLEFIVE(5, "玫瑰淡红系"),
    STYLESIX(6, "丰富彩虹系"),
    STYLESEVEN(7, "治愈天空蓝"),
    STYLEEIGHT(8, "尊贵黑金系"),
    ;
    private int code;
    private String msg;

    private UserVipStyleEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static UserVipStyleEnum getEnumByCode(int code) {
        for (UserVipStyleEnum c : values()) {
            if (c.getCode() == code) {
                return c;
            }
        }
        return null;
    }

    public static String getMsgByCode(int code) {
        for (UserVipStyleEnum c : values()) {
            if (c.getCode() == code) {
                return c.getMsg();
            }
        }
        return null;
    }

    /**
     * getByMsg
     *
     */
    public static UserVipStyleEnum getByMsg(String msg) {
        for (UserVipStyleEnum c : values()) {
            if (c.msg.equals(msg)) {
                return c;
            }
        }
        return null;
    }

    public static Integer getCodeByMsg(String msg) {
        for (UserVipStyleEnum c : UserVipStyleEnum.values()) {
            if (c.msg.equals(msg)) {
                return c.code;
            }
        }
        return null;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }


    public String getKey() {
        return this.name();
    }
}
